package com.mf.basic.config;

import com.mf.basic.utils.UtilsRedis;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * redis配置初始化
 */
@Component
@Slf4j
public class ConfigInitRunner implements CommandLineRunner {

    @Resource
    private UtilsRedis utilsRedis;
    @Resource
    private RedisTemplate<String, Object> rt;

    @Override
    public void run(String... args) {
        utilsRedis.setRedisTemplate(rt);
        log.info(">>>> 注入Redis工具类完成");
    }
}
